<template>
  <div>

      <!-- @zi-message="zichuanfu"是子传父  :fumessage="fumessage"是父传子-->

    <zi @zi-message="zichuanfu" :fumessage="fumessage"></zi>


  </div>
</template>

<script>
import zi from "./zi.vue";

export default {
  name: "fu",
  data() {
    return {
      fumessage: "父组件",
    };
  },

  ////////////////////////////
  //子传父

  methods: {
    zichuanfu(val) {
      console.log(val);
    },
  },
  // updated更新完成周期
  updated() {
    this.zichuanfu();
  },

  ///////////////////////




  // 要引用的组件需要在components里注册
  components: {
    zi,
  },
};
</script>

<style lang="scss" scoped>
</style>